/*
 * Copyright © 2017 eqxiu.com 北京中网易企秀科技有限公司  All rights reserved.
 */
package cn.hermit.data.json.factory;

import cn.hermit.data.json.model.JSONDocument;
import cn.hermit.data.json.model.JSONFactory;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * A JSON Factory using LinkedHashMap as container of JSON Object and 
 * ArrayList as container of JSON Array. It supports JSON Keys by order.
 * 
 * @author Jack Gao (Chinese name : GAO JIANGUO, Email : linux.gjg@gmail.com)
 * @date 14 Jun, 2014
 */
public class OrderedJSONFactory extends JSONFactory {

	/**
	 * Create a container of JSON Object using LinkedHashMap
	 * 
	 * @return
	 * 		a container of JSON Object
	 */
	@Override
	public Map<String, JSONDocument> createObjectContainer() {
		return new LinkedHashMap<String, JSONDocument>();
	}

	/**
	 * Create a container of JSON Array using ArrayList
	 * 
	 * @return
	 * 		a container of JSON Object
	 */
	@Override
	public Collection<JSONDocument> createArrayContainer() {
		return new ArrayList<JSONDocument>();
	}

}